<?php 
require 'global.php';
$keywords=$_GET['keywords'];
if(!$keywords){
	echo "请输入关键字";
	exit;
}
$update=$_GET['update'];
//开始抓取
$sf=new searchFactory($db,$mc,$keywords,$search_urls);
$results=$sf->save_frist_result($update);
//print_r($results);exit;
if(!empty($results)){
foreach($results as $key=>$p){
	//print_r($p);
	?>
	<table cellpadding="0" cellspacing="0" class="result" id="table<?php echo $p -> rid;?>">
		<tbody>
			<tr>
				<td class="f">
					<h3 class="t">
					<a  href="<?echo $p->url;?>" target="_blank">
						<?php 
						echo str_replace($keywords,'<em>'.$keywords.'</em>',$p->title);						
						?>	
						</a><a  href="<? echo $p -> url;?>" target="_blank">下载</a>
					</h3>
					<font> <?echo  str_replace($keywords,'<em>'.$keywords.'</em>',$p->remarks);?><br>
					<span id='size<?php echo $p->rid;?>'  class="size"></span>				
				</font>
				</td>
			</tr>
		</tbody>
	</table>

	<script type="text/javascript">
	var size='#size<?php echo $p->rid;?>';
	$(function() {
		load('<?php echo $p -> rid;?>','<? echo $p -> url;?>','<?php echo $p -> kid;?>');
	});
	
	
</script>
	<?php
	}
}else{
	
	echo "对不起，没有搜索到相关结果！";
	
}

?>


	
	